/****************************************************************************************************
 ** @file       measure.h
 ** @brief      
 ** @details
 **   
 ** @copyright  S7501
 ** @author     yss93
 ** @date       2021/10/13
 **************************************************************************************************/

#ifndef _MEASURE_H
#define _MEASURE_H

#include <time.h>
#include "debug.h"

#define TIME_MEASURE(FUNC) \
    volatile clock_t clock_start;\
    volatile clock_t clock_stop;\
    double secs;           \
    clock_start = clock(); \
    FUNC; \
    clock_stop = clock();      \
    secs = ((double) (clock_stop - clock_start)) \
       / CLOCKS_PER_SEC; \
    DEBUG("Time taken is %e seconds\n",secs)

#endif //_MEASURE_H
